	
			var url = window.location.href;
	
	
			if (url.search("www") >= 0) {
			     var url_base = 'http://www.192.168.1.104/laravel/';
			}else{
			     var url_base = 'http://192.168.1.104/laravel/';
			} 




			function init_fcf(){
				
				//init_left_menu();

				$("#demo-color-variations a").click(function(){
					$("head link#styleswitcher").attr("href", 'contenido/css/variations/' + $(this).data("theme"));
					$.cookie('theme',$(this).data("theme"));
					return false;
				});

				$("#demo-header-variations a").click(function(){
					$("head link#headerswitcher").attr("href", 'contenido/css/variations/' + $(this).data("headertheme"));
					$.cookie('headertheme',$(this).data("headertheme"));
					return false;
				});

				$(".demo-blocks").click(function(){
					$('.fixed-layout').css('background',$(this).css('background'));
					return false;
				});


				// -------------------------------
				// Back to Top button
				// -------------------------------

				$('#back-to-top').click(function () {
					$('body,html').animate({
						scrollTop: 0
					}, 500);
					return false;
				});

				// -------------------------------
				// Panel Collapses
				// -------------------------------
				$('a.panel-collapse').click(function() {
					$(this).children().toggleClass("fa-chevron-down fa-chevron-up");
					$(this).closest(".panel-heading").next().slideToggle({duration: 200});
					$(this).closest(".panel-heading").toggleClass('rounded-bottom');
					return false;
				});
				
				//Toggle Buttons
				//------------------------------
				//On click of left menu
				
				$("a#leftmenu-trigger").click(function () {
					
					
					//collapse-leftbar
					if ((window.innerWidth)<768) {
					   $("body").toggleClass("show-leftbar");
					} else {
					   $("body").toggleClass("collapse-leftbar");

					   //Sets Cookie for Toggle
					   if($.cookie('admin_leftbar_collapse') === 'collapse-leftbar') {
					       $.cookie('admin_leftbar_collapse', '');
					       $('ul.acc-menu').css('visibility', '');

					   } else {
					       $.each($('.acc-menu'), function() {
					           if($(this).css('display') == 'none')
					               $(this).css('display', '');
					       });
					       
					       $('ul.acc-menu:first ul.acc-menu').css('visibility', 'hidden');
					       $.cookie('admin_leftbar_collapse', 'collapse-leftbar');
					   }
					}
					checkpageheight();
					leftbarScrollShow();
				});
				
				
				
				
			}
			
			


			/******** Menu Cargando *********/

			var fcf;
			fcf = fcf || (function () {
				var pleaseWaitDiv = $('<div class="modal fade " style="top:15%" id="compose-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h2>Cargando...</h2></div><div class="modal-body"><div class="progress progress-striped active"><div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div></div></div></div></div></div>');
				var error = '';
				var okDiv = $('<div class="modal fade " style="top:15%;" tabindex="-1" role="dialog" aria-hidden="true">'+
							   	'<div class="modal-dialog" >'+
									'<div class="modal-content">'+
										'<div class="modal-header"><button class="close" data-dismiss="modal">×</button>'+
											'<h2>OK</h2>'+
										'</div>'+
										'<div class="modal-body">'+
										'</div>'+
									'</div>'+
								'</div>'+
							'</div>');
				

				return {
					cargando: function() {
						pleaseWaitDiv.modal();
					},
					hidecargando: function () {
						pleaseWaitDiv.modal('hide');
					},
					error: function() {
						error.modal();
					},
					hideerror: function () {
						error.modal('hide');
					},
					ok: function (){
						okDiv.modal();
					},
					hideok: function (){
						okDiv.modal('hide');
					},
					showText: function (msg,reload){ //recibe texto a mostrar,y evento (true/false) si al cerrar dialog recargamos pagina		
						if(reload === true){
							var text = $('<div class="modal fade " style="top:15%;" tabindex="-1" role="dialog" aria-hidden="true">'+
								   	'<div class="modal-dialog" >'+
									'<div class="modal-content">'+
										'<div class="modal-header"><button class="close" data-dismiss="modal">×</button>'+
											'<h3>Result</h3>'+
										'</div>'+
										'<div class="modal-body">'+msg+
										'</div>'+
									'<div class="modal-footer"><a class="btn" onclick="javascript:fcf.reload();" data-dismiss="modal">OK</a></div>'+
								'</div>'+
							'</div>');
						}
						if(reload === false){
							var text = $('<div class="modal fade " style="top:15%;" tabindex="-1" role="dialog" aria-hidden="true">'+
								   	'<div class="modal-dialog" >'+
									'<div class="modal-content">'+
										'<div class="modal-header"><button class="close"  data-dismiss="modal">×</button>'+
											'<h3>Result</h3>'+
										'</div>'+
										'<div class="modal-body">'+msg+
										'</div>'+
								'</div>'+
							'</div>');
						}
						text.modal(); //iniciamos modal
					},
					hideText: function (){
						text.modal('hide');
					},
					reload: function (){
						location.reload(true);
					}
				};
				
			})();


			/******** Menu Error *********/




			/*
			 * Funcion permite desde el menu superior cambiar el gestor predeterminado 
			 */
			function loadAdmin(id){

				$.ajax({
					url: url_base+"cambioMenuUsuario",
					data: {id_gestor:id},
					type: "POST",			      
					beforeSend: function() {
						fcf.cargando();	
					}, 
					success: function(result){
						fcf.hidecargando();
						if(result == true){
							location.reload();
						}else{
							alert('Error al cambiar menu.');
						}
					}
				});
			}


			function isEmpty(obj) {
			    if (typeof obj == 'undefined' || obj === null || obj === '') return true;
			    if (typeof obj == 'number' && isNaN(obj)) return true;
			    if (obj instanceof Date && isNaN(Number(obj))) return true;
			    return false;
			}

			function habilitar_input(input){
				 
				 if ($(input).attr('disabled'))
					 	 $(input).prop('disabled', false);
				    else $(input).prop('disabled',true);
			}   

			function netejar_input(input){
				$(input).val('');
			}


			function comprobarEmail(email) {
			    var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			    if(!regex.test(email)) {
			       return false;
			    }else{
			       return true;
			    }
			  }

			function stringEsValido(aux){
				if(/^[a-zA-Z0-9- ]*$/.test(aux) == false) { 
					return false; 
				}
			}


			function hide_box(box){
				$('.box').addClass("collapsed-box");
				$(box).slideUp();
			  
			}

			function show_box(box){
				$('.box').addClass("collapsed-box");
				$(box).slideDown();
			}

			function switch_box(header,box){

				if($(header).hasClass("collapsed-box") == false){
					hide_box(box);
				}else if($(header).hasClass("collapsed-box") == true){
					show_box(box);
					$('.box').removeClass("collapsed-box");
				}

			}

			function eliminar_input(input){
				$(input).remove();
			}

			function borrar_lista(lista){
				$("#"+lista).val('');
				$("#"+lista).empty();
			}


			function setVisibilityLeftBar(usuario){
				if($("body" ).hasClass("collapse-leftbar")){
					updateLeftMenu(usuario,'show-leftbar');
				}else{
					updateLeftMenu(usuario,'collapse-leftbar');
					init_left_menu();
					
			}
				
			function init_left_menu(){
			   //Sets Cookie for Toggle
				   if($("body" ).hasClass("collapse-leftbar")) {
					   $('ul.acc-menu:first ul.acc-menu').css('visibility', 'hidden');
				       $.cookie('admin_leftbar_collapse', 'collapse-leftbar');
				       
				   } else {
				       $.each($('.acc-menu'), function() {
				           if($(this).css('display') == 'none')
				               $(this).css('display', '');
				       });
				       $.cookie('admin_leftbar_collapse', '');
				       $('ul.acc-menu').css('visibility', '');
				       
				   }
				}
				checkpageheight();
				leftbarScrollShow();
			}

			/*
			function updateLeftMenu(usuario,valor){
				$.ajax({
				    url: url_base+"update_left_menu",
				    data:{id:usuario,valor:valor},
				    type: "POST",			      
					    beforeSend: function() {
					    	fcf.cargando();
					}, 
					success: function(result){
						fcf.hidecargando();
						location.reload();
				 	}
				}); 
			}
			*/
			
			function cambiar_header(color,usuario){

				$.ajax({
				    url: url_base+"cambio_color_header",
				    type: "POST",	
				    data:{color:color,usuario:usuario},
					beforeSend: function() {
						fcf.cargando();

					}, 
					success: function(result){

						fcf.hidecargando();
						if(result == false){ alert('error');}else{location.reload();}	
				 	}
				});
			}

			function cambiar_color_menu(color,usuario){
				$.ajax({
				    url: url_base+"cambio_color_menu",
				    type: "POST",	
				    data:{color:color,usuario:usuario},
					beforeSend: function() {
						fcf.cargando();
					}, 
					success: function(result){
							fcf.hidecargando();
							if(result == false){ alert('error');}else{
								location.reload();
							}
							
				 	}
				});
			}
			
			
